"""

"""
def input_passwd():
    pwd = input('请输入密码')

    if len(pwd)>=8:
        return pwd

    print('主动抛出异常')

    ex = Exception('密码长度不够')
    raise ex


def raise_ex():


    try:
        print(input_passwd())
    except Exception as e:
        print(e)

def use_assert():

    #断言异常使用
    try:
        assert 1 == 0 , '你的程序在这里发生了什么错误'
    except Exception as e:
        print(e)

use_assert()

